package com.sline.Factory;

public class Test {
    public static void main(String[] args) {
        Dog d = AnimalFactory.createDog();
        Cat c = AnimalFactory.createCat();

        Dog d1 = (Dog) AnimalFactory.createAnimal("dog");
        Cat c1 = (Cat) AnimalFactory.createAnimal("cat");

        d1.eat();
        c1.eat();
    }
}
